{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"\"\"Load an existing vtkStructuredGrid and draw the lines of the velocity field joining them in ribbons\"\"\"\n",
    "\n",
    "import vtk\n",
    "from vedo import *\n",
    "\n",
    "######################## vtk\n",
    "# Read the data and specify which scalars and vectors to read.\n",
    "pl3d = vtk.vtkMultiBlockPLOT3DReader()\n",
    "pl3d.SetXYZFileName(datadir+\"combxyz.bin\")\n",
    "pl3d.SetQFileName(datadir+\"combq.bin\")\n",
    "pl3d.SetScalarFunctionNumber(100)\n",
    "pl3d.SetVectorFunctionNumber(202)\n",
    "pl3d.Update()\n",
    "# this vtkStructuredData already contains a vector field:\n",
    "domain = pl3d.GetOutput().GetBlock(0)\n",
    "\n",
    "######################## vedo\n",
    "box = Mesh(domain, c=None, alpha=0.1)\n",
    "\n",
    "probe = Line([9,0,28], [11,0,33], res=11).color('k')\n",
    "\n",
    "stream = streamLines(domain, probe, direction='backwards', ribbons=2)\n",
    "\n",
    "show(box, probe, stream, viewup='z')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
